package com.michael.demo.springcloud.alibaba.seata.upms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.michael.demo.springcloud.alibaba.seata.upms.entity.Account;
import com.michael.demo.springcloud.alibaba.seata.upms.mapper.AccountMapper;
import com.michael.demo.springcloud.alibaba.seata.upms.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类功能描述:
 * <pre>
 *   xxxx
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2021/04/01 16:44
 */
@Service
public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements AccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public boolean deductByUserId(Long userId, Integer money) {
        return accountMapper.deductByUserId(userId, money) == 1;
    }
}
